package com.peng.controller;

import com.peng.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Api(tags="用户类")
@Controller
public class UserController {
    @Autowired
    private UserService userService;

//    方法上面的注解
    @ApiOperation(value = "用户名字", notes = "获取地址", httpMethod = "GET")
    @RequestMapping("/selectuser")
    @ResponseBody
    public String selectUser(){
        String address = userService.selectUser("admin").getAddress();
        return address;
    }
}
